attribute vec3	inVertex;
attribute vec3	inNormal;
attribute vec2	inUV;

uniform mat4            mvMatrix;
uniform mat4            mvpMatrix;
uniform mediump vec3	lightDirection;


varying mediump     float	fDiffuse;
varying mediump     vec3    fNormal;
varying lowp        vec2    fTexCoord;

void main(void)
{
	gl_Position = mvpMatrix * vec4(inVertex, 1.0);
    
    //calcul light intensity
    vec4 t = mvMatrix * vec4(inNormal, 1.0);
    fNormal = normalize(t.xyz);
    fDiffuse = max(0.0, dot(fNormal, normalize(lightDirection)));

    fTexCoord = inUV;
}
